import { request } from '@pkg/request/src';

export enum Api {
  page = '/system/blacklist/pageList',
  get = '/system/blacklist/get',
  add = '/system/blacklist/add',
  update = '/system/blacklist/update',
  changeEnable = '/system/blacklist/changeEnable',
  remove = '/system/blacklist/remove',
}

export const add = (params) =>
  request.post(
    {
      url: Api.add,
      params: params,
    },
    { errorMessageMode: 'none' },
  );

export const update = (params) =>
  request.post(
    {
      url: Api.update,
      params: params,
    },
    { errorMessageMode: 'none' },
  );

export const changeEnable = (params) => request.post({ url: Api.changeEnable, params: params });

export const remove = (ids: number) => request.post({ url: Api.remove, params: { ids } });
